/*###################################################################*
#
# MP (Mitchell Pell) Base - CrossPlatform Base Utilities.
# Copyright (C) 2014  Mitchell Pell
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
####################################################################*/

#ifndef USES_IO_STREAM_H
#define USES_IO_STREAM_H

#include <iostream>
using namespace std;

namespace mp_base{ namespace interfaces{

	/*!----------------------------------------------------------------
	* @class	UsesIOStream
	* @brief	Virtual class for adding iostream >> and 
	*			<< functionality.
	-----------------------------------------------------------------*/
	class UsesIOStream
	{
	public:

		/*! @brief	Overrides ostreams output operator.  */
		friend ostream& operator<< (ostream &out, UsesIOStream &usesIOS)
			{ return usesIOS.OutStream(out); }
		/*! @brief	Overrides istreams input operator.  */
		friend istream& operator>> (istream &in, UsesIOStream &usesIOS)
			{ return usesIOS.InStream(in); }

	protected:

		/*! @brief	Called by ostreams output operator. */
		virtual ostream& OutStream(ostream &out) = 0;
		/*! @brief	Called by istreams input operator. */
		virtual istream& InStream(istream &in) = 0;

	};

}}

#endif